<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTableVipBaseInfo extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('vip_base_infos', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name', 32)->comment('vip名称');
            $table->decimal('price', 10, 2)->comment('vip价格');

            $table->integer('free_homework_help_count')->comment('作业帮免D币次数');
            $table->float('homework_help_discount', 3, 2)->default(1)->comment('作业帮折扣');

            $table->integer('algorithm_sources_icon')->comment('算法源码D币');
            $table->integer('free_algorithm_sources_count')->comment('免D币算法源码下载次数');
            $table->float('algorithm_sources_discount', 3, 2)->default(1)->comment('算法源码折扣');

            $table->integer('resource_point')->comment('资源积分');
            $table->integer('free_resource_point_count')->comment('免积分资源下载次数');
            $table->float('resource_discount', 3, 2)->default(1)->comment('资源积分折扣');

            $table->tinyInteger('is_exempt_ads')->comment('是否有广告');
            $table->string('privilege_str', 512)->comment('所有特权');
            $table->tinyInteger('date_type')->comment('有效时间类型:1.天 2.月 3.季度 4.年');
            $table->tinyInteger('date_length')->comment('有效时间');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('vip_base_infos');
    }
}
